﻿///-----------------------------------------------------------------------
/// <copyright file="TransactionTabs.cs" company="FactSet Research Systems, Inc.">
///     Copyright © FactSet Research Systems, Inc.  All rights reserved 2012.
/// </copyright>
/// <author>Jonathan K. Barez</author>
///-----------------------------------------------------------------------

namespace HousholdISv2.ViewModel
{
    using System.Collections.ObjectModel;
    using System.Linq;
    using Core;
    using MVVMCore.ViewModel;
    using Transaction;

    public class TransactionTabsViewModel : TabsViewModelBase
    {
        #region Methods

        protected override ObservableCollection<ViewModelBase> InitializeItems()
        {
            return
                new ObservableCollection<ViewModelBase>
                    {
                        new PeriodsViewModel(),
                        new LiquidationViewModel()
                    };
        }

        protected override bool CanGoBack()
        {
            return Items.OfType<IHasItemCollection>().All(vm => vm.IsInSelectionMode);
        }

        #endregion Methods
    }
}
